package org.ghost.parallel.demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.CountDownLatch;

public class CountDownLatchTest implements Runnable {
    private final Logger logger = LoggerFactory.getLogger(CountDownLatchTest.class);

    private CountDownLatch countDownLatch = null;

    public CountDownLatchTest(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        logger.info("*****CountDownLatchTest.run:{}", System.currentTimeMillis());
        countDownLatch.countDown();
    }
}
